clear

echo '\033[32m===编译打包复制到docker目录===\033[0m'
echo ''

menu()
{
cat <<EOF
1. Test
2. Prod
3. Tencent92
EOF
}
menu

profiles=('test' 'prod', 'tencent92')

echo ''
read -p "输入打包环境(回车退出): " r
if [ -z $r ]; then
echo 'exit!';
exit 0;
fi

profile=${profiles[r-1]}

echo ''
echo '\033[32m=========打包后端=========\033[0m'
echo ''

mvn clean package -P${profile} -Dmaven.test.skip=true

mkdir -p docker/service

cp taffeauth-web/target/*.jar docker/service/app.jar
cp taffeauth-web/target/classes/application-${profile}.yml docker/service/application.yml

mkdir -p docker/mysql/sql
cp sql/*.sql docker/mysql/sql/

echo ''
echo ''
echo "\033[32m编译打包复制到docker目录, 完成\033[0m"
echo ''